import sys

from PySide6.QtWidgets import QApplication, QMainWindow

class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()

        self.windowTitleChanged.connect(self.on_window_changed)

        self.windowTitleChanged.connect(lambda x: self.my_custom_fn)

        self.windowTitleChanged.connect(lambda x: self.my_custom_fn(x))

        self.windowTitleChanged.connect(lambda x: self.my_custom_fn(x, 25))

        self.setWindowTitle("This will trigger all signals.")

    def on_window_changed(self, new_title):
        print("Window title changed to", new_title)

    def my_custom_fn(self, a="hello", b=5):
        print(a, b)

app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()


